import { request } from "@/utils/service"

/**
 * @param params 获取中台key列表
 * @returns
 */
export const APIKeyList = (params: any) => {
  return request<any>({
    url: "/key/list",
    method: "POST",
    params
  })
}
/**
 * @param params 生成中台key
 * @returns
 */
export const APIGenerateKey = () => {
  return request<any>({
    url: "/key/add",
    method: "post"
  })
}

/**
 * @param  删除中台key
 * @returns
 */
export const APIDelKey = (params: any) => {
  return request<any>({
    url: "/key/del",
    method: "post",
    params
  })
}

/**
 * @param  启动密钥
 * @returns
 */
export const APIStartUpKey = (id: number) => {
  return request<any>({
    url: "/key/start_up",
    method: "post",
    params: { id }
  })
}
/**
 * @param  关闭密钥
 * @returns
 */
export const APIStopUpKey = (id: number) => {
  return request<any>({
    url: "/key/stop_up",
    method: "post",
    params: { id }
  })
}
